package cn.shengchao.examstar.product.infrastructure.dao;

import cn.shengchao.examstar.product.infrastructure.dao.po.TProductCourseSetting;
import cn.shengchao.examstar.rpc.product.req.ProductCourseSettingPageQuery;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface TProductCourseSettingDao extends BaseMapper<TProductCourseSetting> {
     //查询产品有效期是否重叠
     int countProductValidPeriod(@Param("productId")Long productId, @Param("startTime")Date startTime, @Param("endTime")Date endTime);

    List<TProductCourseSetting> selectProductCourseSettingByQuery(@Param("query")ProductCourseSettingPageQuery query);

    List<TProductCourseSetting> selectListByCourseId(@Param("courseId") Long productId);

    List<TProductCourseSetting> selectListByLessonId(@Param("lessonId")Long productId,@Param("sectionIds") List<Long> sectionIds);

    long countGanKaoProductValidPeriod(@Param("startTime")Date startTime, @Param("endTime")Date endTime);
}
